Repository navigation
RBD/NAS: address review comments - #14873
weizhouapache wants to merge 5 commits into
Conversation
rbd import-diff resizes the image to the size recorded in each diff, which is the size the volume had when that backup was taken. A volume grown since then keeps its new size in the database, so the restored image would be smaller than the volume. Resize the image back to the size it was recreated with once the chain has been replayed.
getVMHypervisorHost dereferenced the result of hostDao.findById, which is null for a host which has been removed, so removing an Instance with an RBD volume from its backup offering failed with a NullPointerException now that it looks up a host to remove the backup anchors. Fall back to the cluster of the root volume, as for an Instance without a last host. Removing the anchors is best effort, a later full backup sweeps them, so a runtime failure there is logged instead of failing the caller.
The disk paths handed to the script are RBDStringBuilder strings, which carry the cephx key. Log the volume paths instead.
A suspend which timed out can still complete in libvirt after the client was killed, so the Instance could stay paused with the state file gone. Attempt the resume whenever a suspend was attempted; only an Instance which is still paused afterwards is an error.
…mount the NAS The RBD path only trapped TERM/HUP/INT to release the guest, and cleared it once the snapshots were taken, so a script killed mid-export (agent restart, or a timeout of the agent) left the NAS mounted with the partial backup and the new anchor behind. Arm an EXIT trap once the NAS is mounted, as the pull mode path does, and clear it once the backup is complete. It releases the guest, removes the new anchor and the partial backup, and unmounts the NAS. The explicit failure paths now exit through the trap. Every disk a snapshot was attempted on is listed, as a snapshot which timed out can still be created by Ceph afterwards.
|
@blueorangutan package |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #14873 +/- ##
=========================================
Coverage 20.92% 20.92%
- Complexity 21142 21150 +8
=========================================
Files 6057 6057
Lines 549556 549565 +9
Branches 73477 73481 +4
=========================================
+ Hits 114991 115012 +21
+ Misses 421116 421103 -13
- Partials 13449 13450 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@blueorangutan package |
|
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 20190 |
|
[SF] Trillian test result (tid-238)
|
|
this is ready for review |
Description
This PR addresses @abh1sar 's review comments on #14386, which was merged before they were handled.
rbd import-diffresizes the image to the size recorded in each diff (do_image_resizein Ceph'sImport.cc), so restoring after a volume resize (in place, orcreateVMFromBackuponto a larger disk) left the image at its backup-time size while the database kept the new one. The restore now resizes the image back to the Volume's size after replaying the diff chain (NAS backup: support incremental backups of RBD volumes #14386 (comment)).Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
NASBackupProviderTest,LibvirtRestoreBackupCommandWrapperTest(new test: the image is resized back to its size after the diffs are applied),LibvirtTakeBackupCommandWrapperTestand the anchor removal wrapper test.nasbackup.shchecked with a stub harness.test/integration/smoke/test_backup_recovery_nas.pyon a KVM zone with Ceph RBD and NFS primary storage: 12 tests, OK (2 skipped by design).Not covered: restoring a grown Volume end to end on a real cluster, and killing a backup mid-export on a real host.
How did you try to break this feature and the system with this change?